import { request } from "@/utils/service"
import { getToken } from "@/utils/cache/cookies"
import axios from "axios"
const baseURL = import.meta.env.VITE_BASE_API
/** 根据id查详情 */
export function getProductInfoApi(params: any) {
  return request({
    url: "appletys/package/queryId",
    method: "get",
    params
  })
}

// 佣金结算列表

export function getSettleList(params: any) {
  return request({
    url: "/yun/balance/query",
    method: "get",
    params
  })
}

// 提现记录详情
export function getwithdrawList(params: any) {
  return request({
    url: "/yun/withdraw/query",
    method: "get",
    params
  })
}
// 修改提现记录 yun/withdraw/update
export function getwithdrawUpdate(data: any) {
  return request({
    url: "/yun/withdraw/update",
    method: "put",
    data
  })
}
// 查询分销商账号 /yun/user/query
export function getyunuser(params: any) {
  return request({
    url: "/yun/user/query",
    method: "get",
    params
  })
}
// 查询所有分销商账号 /yun/user/query
export function getyunuserAll() {
  return request({
    url: "/yun/user/queryAll",
    method: "get"
  })
}

//是否禁用账号

export function banUser(data: any) {
  return request({
    url: "/yun/user/isBan",
    method: "put",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data
  })
}
// 云尚账号绑定
export function bandingUser(data: any) {
  return request({
    url: "/yun/user/binding",
    method: "put",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data
  })
}
// 下载投诉已完结
export function yongjinjiesuandown(data: any) {
  return axios({
    url: `${baseURL}/yun/balance/downData`,
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    responseType: "blob",
    data
  })
}
// 下载打款成功
export function dakuanjiesuandown(data: any) {
  return axios({
    url: `${baseURL}/yun/withdraw/downData`,
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    responseType: "blob",
    data
  })
}

//导出代理列表

export function exportExcelList(data: any) {
  return axios({
    url: `${baseURL}/yun/user/down`,
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    responseType: "blob",
    data
  })
}
